3.1.18 \(\int \cos (c+d x) (a+a \sin (c+d x))^2 \, dx\) [18]

Optimal. Leaf size=22 \[ \frac {(a+a \sin (c+d x))^3}{3 a d} \]

[Out]

1/3*(a+a*sin(d*x+c))^3/a/d

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {2746, 32} \begin {gather*} \frac {(a \sin (c+d x)+a)^3}{3 a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]*(a + a*Sin[c + d*x])^2,x]

[Out]

(a + a*Sin[c + d*x])^3/(3*a*d)

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rule 2746

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^(m + (p - 1)/2)*(a - x)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& IntegerQ[(p - 1)/2] && EqQ[a^2 - b^2, 0] && (GeQ[p, -1] ||  !IntegerQ[m + 1/2])

Rubi steps

\begin {align*} \int \cos (c+d x) (a+a \sin (c+d x))^2 \, dx &=\frac {\text {Subst}\left (\int (a+x)^2 \, dx,x,a \sin (c+d x)\right )}{a d}\\ &=\frac {(a+a \sin (c+d x))^3}{3 a d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.12, size = 37, normalized size = 1.68 \begin {gather*} -\frac {a^2 (6 \cos (2 (c+d x))-15 \sin (c+d x)+\sin (3 (c+d x)))}{12 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]*(a + a*Sin[c + d*x])^2,x]

[Out]

-1/12*(a^2*(6*Cos[2*(c + d*x)] - 15*Sin[c + d*x] + Sin[3*(c + d*x)]))/d

________________________________________________________________________________________

Maple [A]
time = 0.08, size = 21, normalized size = 0.95

method result size
derivativedivides \(\frac {\left (a +a \sin \left (d x +c \right )\right )^{3}}{3 d a}\) \(21\)
default \(\frac {\left (a +a \sin \left (d x +c \right )\right )^{3}}{3 d a}\) \(21\)
risch \(\frac {5 a^{2} \sin \left (d x +c \right )}{4 d}-\frac {a^{2} \sin \left (3 d x +3 c \right )}{12 d}-\frac {a^{2} \cos \left (2 d x +2 c \right )}{2 d}\) \(50\)
norman \(\frac {\frac {4 a^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {4 a^{2} \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {2 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {20 a^{2} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {2 a^{2} \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}\) \(111\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*(a+a*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/3*(a+a*sin(d*x+c))^3/d/a

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 20, normalized size = 0.91 \begin {gather*} \frac {{\left (a \sin \left (d x + c\right ) + a\right )}^{3}}{3 \, a d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+a*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

1/3*(a*sin(d*x + c) + a)^3/(a*d)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 44 vs. \(2 (20) = 40\).
time = 0.36, size = 44, normalized size = 2.00 \begin {gather*} -\frac {3 \, a^{2} \cos \left (d x + c\right )^{2} + {\left (a^{2} \cos \left (d x + c\right )^{2} - 4 \, a^{2}\right )} \sin \left (d x + c\right )}{3 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+a*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

-1/3*(3*a^2*cos(d*x + c)^2 + (a^2*cos(d*x + c)^2 - 4*a^2)*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 53 vs. \(2 (15) = 30\).
time = 0.13, size = 53, normalized size = 2.41 \begin {gather*} \begin {cases} \frac {a^{2} \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {a^{2} \sin ^{2}{\left (c + d x \right )}}{d} + \frac {a^{2} \sin {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a \sin {\left (c \right )} + a\right )^{2} \cos {\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+a*sin(d*x+c))**2,x)

[Out]

Piecewise((a**2*sin(c + d*x)**3/(3*d) + a**2*sin(c + d*x)**2/d + a**2*sin(c + d*x)/d, Ne(d, 0)), (x*(a*sin(c)
+ a)**2*cos(c), True))

________________________________________________________________________________________

Giac [A]
time = 3.75, size = 20, normalized size = 0.91 \begin {gather*} \frac {{\left (a \sin \left (d x + c\right ) + a\right )}^{3}}{3 \, a d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+a*sin(d*x+c))^2,x, algorithm="giac")

[Out]

1/3*(a*sin(d*x + c) + a)^3/(a*d)

________________________________________________________________________________________

Mupad [B]
time = 4.55, size = 32, normalized size = 1.45 \begin {gather*} \frac {a^2\,\sin \left (c+d\,x\right )\,\left ({\sin \left (c+d\,x\right )}^2+3\,\sin \left (c+d\,x\right )+3\right )}{3\,d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)*(a + a*sin(c + d*x))^2,x)

[Out]

(a^2*sin(c + d*x)*(3*sin(c + d*x) + sin(c + d*x)^2 + 3))/(3*d)

________________________________________________________________________________________